from django.db import models

# Create your models here.
#客户表
class customers(models.Model):
    name=models.CharField(max_length=255)
    email=models.CharField(max_length=255)
    password=models.CharField(max_length=255)
    phone=models.CharField(max_length=255)
    create_time = models.DateTimeField(auto_now_add=True)
    update_time = models.DateTimeField(auto_now_add=True)
#订单表
class orders(models.Model):
    product_name=models.CharField(max_length=255)
    quantity=models.IntegerField()
    price=models.CharField(max_length=255)
    order_date=models.DateTimeField(auto_now_add=True)
    status=models.CharField(max_length=255)
    customer_id=models.ForeignKey(customers,on_delete=models.CASCADE,related_name='orders')
